package cn.rengy.web.framework.wxmp.message;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.rengy.lang.ResultEntity;

@RequestMapping(value = "/wxappmsg")
public class WXAppMessageController {
	private static Logger logger = LoggerFactory.getLogger(WXAppMessageController.class);
	@Autowired
	private WXAppMessageService wXAppMessageService;
	
	@Autowired
	private WxSecurityCodeService wxSecurityCodeService;
	/**
	 * 发送模板消息
	 * @param paramMap
	 * @return
	 */
	@RequestMapping(value="/templateMsg",method = RequestMethod.POST)
	@ResponseBody
	public ResultEntity templateMsg (@RequestBody Map<String,Object> paramMap){
		wXAppMessageService.templateMsg(paramMap);
		return ResultEntity.ok();
	}
	/**
	 * 发送微信验证码
	 * @param paramMap
	 * @return
	 */
	@RequestMapping(value="sendSecurityCode",method=RequestMethod.POST)
	@ResponseBody
    public ResultEntity sendSecurityCode(@RequestBody Map<String,Object> paramMap){
		//
        return wxSecurityCodeService.sendSecurityCode(paramMap);
    }
}
